package com.guigu.zj.controller;

import com.guigu.pojo.Ychecknape;
import com.guigu.zj.pojo.PageVo;
import com.guigu.zj.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CheController {
    @Autowired
    CheckService checkService;
    @RequestMapping("/Z_queryChe")

    public PageVo<Ychecknape> queryChe(@RequestBody PageVo pageVo){
       return checkService.queryAll(pageVo);
    }
    @RequestMapping("/Z_addChe")
    public int addChe(@RequestBody Ychecknape ychecknape){
        return  checkService.insertSelective(ychecknape);
    }
    @RequestMapping("/Z_byId")
    public Ychecknape byidChe(@RequestBody Ychecknape ychecknape){
        return checkService.selectByPrimaryKey(ychecknape.getId());
    }
    @RequestMapping("/Z_upChe")
    public int upChe(@RequestBody Ychecknape ychecknape){
        return checkService.updateByPrimaryKeySelective(ychecknape);
    }
    @RequestMapping("/Z_delChe")
    public  int delChe(Integer id){

        return checkService.deleteByPrimaryKey(id);
    }
}
